<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h2>hello~~~</h2>
    <button onclick="buy()">buy</button>
    <span id="result"></span>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script>
        function buy(){
            // debugger
            //客户端调试程序的方式：debugger、log、排除法
            console.log("==buy()==")
            let url = "http://localhost:9000/nacos/provider/echo/abcd";
            let span = document.getElementById("result");
            axios.get(url).then(function (response){
              console.log(response.data);
              span.innerText = response.data;
            })
            .catch(function (error){
                console.log(error);
            })
        }


    </script>
</body>
</html>